package io.properties;

import io.serializable.Student;

import java.io.FileInputStream;
import java.lang.reflect.Constructor;
import java.util.Properties;

public class Test1 {
    public static void main(String[] args) throws Exception {
        Properties prop = new Properties();
        FileInputStream is = new FileInputStream("AdvancedCode\\src\\io\\properties\\my_class.properties");
        prop.load(is);
        is.close();
        Class<?> clazz = Class.forName(prop.getProperty("className"));
        Constructor<?> constructor = clazz.getDeclaredConstructor(String.class,Integer.class,String.class);
        Student o = (Student)constructor.newInstance("虚鲲",23,"篮球");
        System.out.println(o);
    }
}
